/**
  ******************************************************************************
  * @file    Display.h  
  * @author  Dajin Li
  * @version V0.0.1
  * @date    08-08-2015 
  * @brief   This file contains headers for LCD dissplay function 
  *          
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; KION(SZ) R&D Center
  *
  * Licensed under KION, (the "License");
  *
  ******************************************************************************
  */

#ifndef __DISPLAY_H
#define __DISPLAY_H

#include "stm32f10x.h"
#include "global.h"
#include "var_tbl.h"


#define BAR_SCREEN_INITERR              9
#define BAR_SCREEN_OILERR               9
#define BAR_SCREEN_TEMPERROR            9
#define BAR_SCREEN_USERERR              4
#define BAR_SCREEN_TIME                 11
#define BAR_SCREEN_DELETE_WARNING       12
#define BAR_SCREEN_HOURMETER            13
#define BAR_SCREEN_ADJUST               13
#define BAR_SCREEN_PINCOD               15
#define BAR_SCREEN_SERVICE_WITH_ERR     15
#define BAR_SCREEN_SERVICE_NO_ERR       7
#define BAR_SCREEN_TEMPERROR2           13

#define MAX_TRACTION_SPD_MPH                    160
#define MIN_TRACTION_SPD_MPH                    0

#define MAX_ID_SYSTEM_SPD_MPH                   25
#define MIN_ID_SYSTEM_SPD_MPH                   1

#define MAX_MAINTENANCE_DAYS                    1000
#define MAX_MAINTENANCE_HOURS                   5000

#define ERROR_NONE                              0x00
#define ERROR_CODE_ACCUR                        0x01
#define ERROR_OIL_LACK                          0x02
#define ERROR_OVER_TEMPURATE                    0x03
#define ERROR_MAINTENCE_WARNING                 0x04
#define ERROR_BATCUTOFF_WARNING                 0x05
#define ERROR_BATT_LOW                          0x06

#define LANGUAGE_EN                             0x00
#define LANGUAGE_CH                             0x01

#define Lead_Bat                                0x00
#define Li_Bat                                  0x01
extern u32 graphical_area;
extern u32 graphical_area_flash;
extern u8 hourmeter_display;
extern u16 previous_grapical_area; // need to draw all
extern u16 welcom_mode_counter;
extern u16 Disp_LiftErrCode[4];
extern u16 Disp_TracErrCode[4];
extern u16 Disp_SteerErrCode[4];
extern U16 Disp_DhsbErrCode[4];
extern U16 Err_Code_Hide_flag;
extern U16 Err_Code_Exist_flag;
extern U16 Err_Oil_Hide_flag;
extern U16 Err_Oil_Exist_flag;
extern U16 Err_Temp_Hide_flag;
extern U16 Err_Temp_Exist_flag;
extern U16 OilErrCodeDealFlag;
extern U16 TempurateErrCodeDealFlag;
extern U8 Current_Bat_Soc;
extern U8 Battary_type;
extern U8 Li_BattCon;
extern U16 Err_Maint_Hide_flag;
extern U16 Err_Maint_Exist_flag;
extern U16 MaintErrCodeDealFlag;
extern U16 Err_BatCutoff_Hide_flag;
extern U16 Err_BatCutoff_Exist_flag;
extern U16 BatCutoffDealFlag;
extern U16 Err_Batlow_Hide_flag;
extern U16 Err_Batlow_Exist_flag;
extern U16 BatLowDealFlag;
extern U32 pre_DigicodeArray1Value;
extern U32 pre_DigicodeArray2Value;
extern U32 pre_DigicodeArray3Value;
extern U32 pre_DigicodeArray4Value;
extern U32 pre_DigicodeArray5Value;
extern U32 pre_DigicodeArray6Value;
extern U32 pre_DigicodeArray7Value;
extern U32 pre_DigicodeArray8Value;

extern void Screen_welcome(void);
extern void Screen_lighting(int bk_light_level);
extern void Screen_pincode(void);
extern void Screen_maintence_info(void);
extern void Screen_error_code_init(void);
extern void Screen_show_time(void);
extern void Screen_show_hourmeter(void);
extern void Screen_show_service(void);
extern void Screen_error_code_user(void);
extern void Screen_AdjustLightness(void);
extern U8 error_dect(void);
extern void Screen_error_Oil(void);
extern void Screen_error_Temp1(void);
extern void Screen_error_Temp2(void);
extern void Screen_ErrorDelet_Dialog(void);
extern void Screen_error_Maint(void);
extern void err_mode_detect(void);
extern void Screen_error_BatCutoff(void);
extern void Screen_Bat_low(void);
extern void Screen_admin_pincode(void);
extern void Screen_Pincode_reset(void);
extern void Screen_DigiCodeEnsure_Dialog(void);
#endif

